package net.aiform.template.service;

import java.util.UUID;

import net.aiform.template.dao.TemplateDao;
import net.aiform.template.pojo.Template;

public class TemplateServiceImpl implements TemplateService {
	TemplateDao templateDao;

	@Override
	public Template getNewTemplate() {
		Template t = new Template();
		String id = UUID.randomUUID().toString().replaceAll("-", "");
		t.setCode(id);
		return t;
	}

	@Override
	public void save(Template template) {
		templateDao.save(template);
	}

	public TemplateDao getTemplateDao() {
		return templateDao;
	}

	public void setTemplateDao(TemplateDao templateDao) {
		this.templateDao = templateDao;
	}

}
